<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>filterTest20171222</title>
{#    <script src="../js/jquery-2.1.3.min.js"></script>#}
{#    <style>#}
{#        * {#}
{#            margin: 0;#}
{#            padding: 0;#}
{#        }#}
{#    </style>#}
</head>
<body>
    <h2> 内置过滤器测试</h2>
{#    ======================== 20171222 10:50#}
{#    内置过滤器测试#}

    <!-- title过滤器 -->
    <div>
        <span>title过滤器：</span> <br>
        <p>{{ value|title }}</p>
        <hr/>
    </div>

    <!-- linenumbers过滤器 -->
    <div>
        <span>linenumbers过滤器：</span> <br>
        <p>{{ value|linenumbers|linebreaksbr }}</p>
        <hr/>
    </div>

    <!-- length过滤器 -->
    <div>
        <span>length过滤器：</span> <br>
        <p>{{ value|length }}</p>
        <hr/>
    </div>

    <!-- join过滤器 -->
    <div>
        <span>join过滤器：</span> <br>
        <p>{{ value|join:" // " }}</p>
        <hr/>
    </div>


    <!-- safe过滤器 -->
    <div>
        <span>safe过滤器：</span> <br>
        <p>{{ value|safe }}</p>
        <hr/>
    </div>

    <!-- floatformat过滤器 -->
    <div>
        <span>floatformat过滤器：</span> <br>
        <p>dotWidth:-1;结果：{{ value|floatformat }}</p>
        <p>dotWidth:3;结果：{{ value|floatformat:3 }}</p>
        <p>dotWidth:-6;结果：{{ value|floatformat:-6 }}</p>
        <hr/>
    </div>

    <!-- escape过滤器 -->
{#    {{ value|escape }}#}
    <div>
        <span>escape过滤器：</span> <br>
        <p>{{ value|escape }}</p>
        <hr/>
    </div>


    <!-- escapejs过滤器 -->
    <div>
        <span>escapejs过滤器：</span> <br>
        <p>{{ value|escapejs }}</p>
{#        <p>{{ value|force_escape }}</p>#}
        <hr/>
    </div>

    <!-- center过滤器 -->
    <div>
        <span>center过滤器：</span> <br>
        <p>{{ value|center:'10' }}</p>
        <hr/>
    </div>


    <!-- dictsortreversed过滤器 -->
    <div>
        <span>dictsortreversed过滤器：</span> <br>
        {{ value|dictsortreversed:"age" }}
        <hr/>
    </div>


    <!-- dictsort过滤器 -->
    <div>
        <span>dictsort过滤器：</span> <br>
        {{ value|dictsort:"name" }}
        <hr/>
    </div>


    <!-- default过滤器 -->
    <div>
        <span>default过滤器：</span> <br>
        {{ value|default:"nothing" }}
        <hr/>
    </div>



{#    <!-- date过滤器 -->#}
{#    <div>#}
{#        <span>date过滤器：</span> <br>#}
{#        {{ value|date }}#}
{#        <hr/>#}
{#    </div>#}


    <!-- cut过滤器 -->
    <div>
        <span>cut过滤器：</span> <br>
        {{ value|cut:"a" }}
        <hr/>
    </div>

    <!-- capfirst过滤器 -->
    <div>
        <span>capfirst过滤器：</span> <br>
        {{ value|capfirst }}
        <hr/>
    </div>


    <!-- addslashes过滤器 -->
    <div>
        <span>addslashes过滤器：</span> <br>
        {{ value|addslashes }}
        <hr/>
    </div>

    <!-- add过滤器 -->
    <div>
        <span>add过滤器：</span> <br>
        {{ value|add:"2" }}
        <hr/>
    </div>


</body>
</html>